{ INFORMATICS.MCCME.RU
  Problem statement: http://informatics.mccme.ru/moodle/mod/statements/view3.php?chapterid=1406
  Verdict: Accepted
}
uses SysUtils;
 
var
	i,ls,kk:longint;
	s,t:string;
	f:boolean;
 
begin
reset(input,'input.txt');
rewrite(output,'output.txt');
readln(s);
readln(t);
ls:=length(t);
if length(s)=length(t) then begin
	f:=true;
	for i:=1 to ls do begin
		kk:=pos(t[i],s);
		if kk=0 then begin
			f:=false;
			break;
		end else delete(s,kk,1);
	end;
end else f:=false;
if f then write('YES') else write('NO');
end.